home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Graphics / Graphic Demos / Stair Draw / source / Stair_Main < prev    next >
Encoding:
Text File  |  1987-01-18  |  1.3 KB  |  52 lines  |  [TEXT/PJMM]

  1. {** STAIR PROGRAM **}
  2. {Program to layout and draw stair section    }
  3. {Version 0.90     01/18/87      G. Langdon    }
  4.  
  5. {**   MAIN PROGRAM   **                                        }
  6. {The main program opens the window and menus and        }
  7. {displays the configuration dialog.  Once the selections    }
  8. {are made and the OK button is clicked, the stair layout    }
  9. { is calculated     and drawn.  The program then enters an     }
  10. {event loop, until the user selects quit or the configur-    }
  11. {ation dialog to begin again.                                    }
  12.  
  13. PROGRAM Stair_Main;
  14.     {$I-}
  15.  
  16.     USES
  17.         Stair_Globals, Stair_Program;
  18.  
  19. BEGIN  {main program}
  20.     SetUpSys;
  21.     RunDialog;
  22.     REPEAT
  23.         UpdateSys;
  24.         IF GetNextEvent(everyEvent, theEvent) THEN
  25.             CASE theEvent.what OF
  26.                 mouseDown : 
  27.                     CASE FindWindow(theEvent.where, theWindow) OF
  28.                         inMenuBar : 
  29.                             SelectMenu(MenuSelect(theEvent.where));
  30.                         inSysWindow : 
  31.                             SystemClick(theEvent, theWindow);
  32.                         inContent : 
  33.                             WindowScroll(theWindow, theEvent.where);
  34.                         inDrag : 
  35.                             DragWindow(theWindow, theEvent.where, DragBnds);
  36.                         inGrow : 
  37.                             WindowGrow(theWindow);
  38.                         inGoAway : 
  39.                             IF TrackGoAway(theWindow, theEvent.where) THEN
  40.                                 DoGoAway(theWindow);
  41.                         OTHERWISE
  42.                             ;
  43.                     END;
  44.                 keyDown : 
  45.                     KeyEvent(Chr(theEvent.message MOD 256));
  46.                 updateEvt, activateEvt : 
  47.                     WindowUpdate(DrawWindow);
  48.                 OTHERWISE
  49.                     ;
  50.             END;
  51.     UNTIL done;
  52. END.